﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Drawing;
using System.Drawing.Drawing2D;

namespace SimpleBomberman
{
    public class BrickWall : Wall
    {
        #region Constructors

        public BrickWall() : base() { }
        public BrickWall(int x, int y, int length) : base(x, y, length) { }

        #endregion Constructors

        #region Public Override Methods

        public override void Draw(Graphics g)
        {
            Pen silverPen = new Pen(Color.Silver);
            Pen whitePen = new Pen(Color.White, 2);
            Pen blackPen = new Pen(Color.Black, 2);
            Rectangle rectangle = new Rectangle(this.X, this.Y, this.Length - 2, this.Length - 2);
            g.DrawRectangle(silverPen, rectangle);
            g.FillRectangle(Brushes.Silver, rectangle);

            //------- Black lines -------
            g.DrawLine(blackPen, this.X, this.Y + 1, this.X + this.Length - 1, this.Y + 1);
            g.DrawLine(blackPen, this.X + 1, this.Y, this.X + 1, this.Y + 4);
            g.DrawLine(blackPen, this.X + this.Length - 1, this.Y, this.X + this.Length - 1, this.Y + this.Length / 3);

            g.DrawLine(blackPen, this.X, this.Y + this.Length / 3, this.X + this.Length, this.Y + this.Length / 3);
            g.DrawLine(blackPen, this.X + this.Length / 3, this.Y + this.Length / 3, this.X + this.Length / 3, this.Y + 2 * this.Length / 3);
            g.DrawLine(blackPen, this.X + this.Length / 3 + 1, this.Y + this.Length / 3, this.X + this.Length / 3 + 1, this.Y + this.Length / 3 + 3);

            g.DrawLine(blackPen, this.X, this.Y + 2 * this.Length / 3, this.X + this.Length, this.Y + 2 * this.Length / 3);
            g.DrawLine(blackPen, this.X + 2 * this.Length / 3, this.Y + 2 * this.Length / 3, this.X + 2 * this.Length / 3, this.Y + this.Length);
            g.DrawLine(blackPen, this.X + 2 * this.Length / 3 + 1, this.Y + 2 * this.Length / 3, this.X + 2 * this.Length / 3 + 1, this.Y + 2 * this.Length / 3 + 3);

            g.DrawLine(blackPen, this.X, this.Y + this.Length - 1, this.X + this.Length, this.Y + this.Length - 1);

            //------- White lines -------
            g.DrawLine(whitePen, this.X + 2, this.Y + 3, this.X + this.Length - 2, this.Y + 3);
            g.DrawLine(whitePen, this.X + 1, this.Y + 4, this.X + 1, this.Y + this.Length / 3 - 1);

            g.DrawLine(whitePen, this.X, this.Y + this.Length / 3 + 2, this.X + this.Length / 3 - 1, this.Y + this.Length / 3 + 2);
            g.DrawLine(whitePen, this.X + this.Length / 3 + 2, this.Y + this.Length / 3 + 2, this.X + this.Length, this.Y + this.Length / 3 + 2);
            g.DrawLine(whitePen, this.X + this.Length / 3 + 2, this.Y + this.Length / 3 + 3, this.X + this.Length / 3 + 2, this.Y + 2 * this.Length / 3 - 1);

            g.DrawLine(whitePen, this.X, this.Y + 2 * this.Length / 3 + 2, this.X + 2 * this.Length / 3 - 1, this.Y + 2 * this.Length / 3 + 2);
            g.DrawLine(whitePen, this.X + 2 * this.Length / 3 + 2, this.Y + 2 * this.Length / 3 + 2, this.X + this.Length, this.Y + 2 * this.Length / 3 + 2);
            g.DrawLine(whitePen, this.X + 2 * this.Length / 3 + 2, this.Y + 2 * this.Length / 3 + 3, this.X + 2 * this.Length / 3 + 2, this.Y + this.Length - 2);
         }

        #endregion Public Override Methods
    }
}
